<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use app\modules\cruise\models\Room;

//获取所有房间类型

$room = Room::find()->where(['status'=>1])->all();

$room_arr = [];

foreach($room as $r){
    $room_arr[$r->id] = $r->name.' '.$r->code;
}

?>

<div class="room-use-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
        'layout' => 'inline',
    ]); ?>

    <?= $form->field($model, 'room_id')->dropdownList($room_arr, ['prompt'=>'选择房间简码']) ?>
    <?= $form->field($model, 'name')->textInput(['placeholder' => '姓名']) ?>

    <?= $form->field($model, 'code')->textInput(['placeholder' => '房间号']) ?>

    <?= $form->field($model, 'download')->dropdownList(Yii::$app->params['download'], ['prompt'=>'选择下载状态'])  ?>

  
    <div class="form-group">
        <?= Html::submitButton('查询', ['class' => 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
